from django.conf.urls.defaults import patterns, include, url

from bayanihan.settings import DEBUG
from django.conf import settings
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('bayanihan.maps.views',
    url(r'^$', 'view_all_reports', name='index'),
    url(r'^submit/$', 'add_report', name='submit-report'),
    url(r'^deployments/(?P<deployment_id>\w+)/$', 'list_all_reports'),
    url(r'^deployments/$', 'list_all_reports', {'deployment_id' : ''}),
    url(r'^reports/(?P<report_id>\w+)/$', 'view_single_report'),
    url(r'^deploy/$', 'create_deployment', name='create-deployment'),
    url(r'^login/$', 'sign_in'),
    url(r'^register/$', 'register'),
    url(r'^validate/$', 'validate_reports'),
    url(r'^members/$', 'view_members'),
    url(r'^logout/$', 'sign_out'),
    url(r'^test/$', 'test'),
    url(r'^features/$', 'features'),
    (r'^admin/', include(admin.site.urls)),
)

urlpatterns += patterns('',
	(r'^accounts/', include('registration.urls')),
)

if DEBUG:
    urlpatterns += patterns('', (
        r'^media/(?P<path>.*)$',
        'django.views.static.serve',
        {'document_root': settings.MEDIA_ROOT,
		'show_indexes': True}
    ))